package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="order_log" )
public class OrderLog extends BaseObject implements Serializable {
    private Long orderLogId;
    private String behavior;
    private Long createTime;
    private String logText;
    private Long opId;
    private String opName;
    private byte opType;
    private Long orderId;
    private byte result;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getOrderLogId() {
        return this.orderLogId;
    }
    
    public void setOrderLogId(Long orderLogId) {
        this.orderLogId = orderLogId;
    }
    
    @Column(name="behavior", nullable=false, length=20)
    public String getBehavior() {
        return this.behavior;
    }
    
    public void setBehavior(String behavior) {
        this.behavior = behavior;
    }
    
    @Column(name="create_time", nullable=false)
    public Long getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
    
    @Column(name="log_text", nullable=false)
    public String getLogText() {
        return this.logText;
    }
    
    public void setLogText(String logText) {
        this.logText = logText;
    }
    
    @Column(name="op_id", nullable=false)
    public Long getOpId() {
        return this.opId;
    }
    
    public void setOpId(Long opId) {
        this.opId = opId;
    }
    
    @Column(name="op_name", nullable=false, length=30)
    public String getOpName() {
        return this.opName;
    }
    
    public void setOpName(String opName) {
        this.opName = opName;
    }
    
    @Column(name="op_type", nullable=false)
    public byte getOpType() {
        return this.opType;
    }
    
    public void setOpType(byte opType) {
        this.opType = opType;
    }
    
    @Column(name="order_id", nullable=false)
    public Long getOrderId() {
        return this.orderId;
    }
    
    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }
    
    @Column(name="result", nullable=false)
    public byte getResult() {
        return this.result;
    }
    
    public void setResult(byte result) {
        this.result = result;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OrderLog pojo = (OrderLog) o;

        if (behavior != null ? !behavior.equals(pojo.behavior) : pojo.behavior != null) return false;
        if (createTime != null ? !createTime.equals(pojo.createTime) : pojo.createTime != null) return false;
        if (logText != null ? !logText.equals(pojo.logText) : pojo.logText != null) return false;
        if (opId != null ? !opId.equals(pojo.opId) : pojo.opId != null) return false;
        if (opName != null ? !opName.equals(pojo.opName) : pojo.opName != null) return false;
         if (orderId != null ? !orderId.equals(pojo.orderId) : pojo.orderId != null) return false;
 
        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (behavior != null ? behavior.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (logText != null ? logText.hashCode() : 0);
        result = 31 * result + (opId != null ? opId.hashCode() : 0);
        result = 31 * result + (opName != null ? opName.hashCode() : 0);
         result = 31 * result + (orderId != null ? orderId.hashCode() : 0);
 
        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("orderLogId").append("='").append(getOrderLogId()).append("', ");
        sb.append("behavior").append("='").append(getBehavior()).append("', ");
        sb.append("createTime").append("='").append(getCreateTime()).append("', ");
        sb.append("logText").append("='").append(getLogText()).append("', ");
        sb.append("opId").append("='").append(getOpId()).append("', ");
        sb.append("opName").append("='").append(getOpName()).append("', ");
        sb.append("opType").append("='").append(getOpType()).append("', ");
        sb.append("orderId").append("='").append(getOrderId()).append("', ");
        sb.append("result").append("='").append(getResult()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
